home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-10-13 | 4.1 KB | 116 lines | [TEXT/MMCC] |
- Greg Anderson
- First rev: March 1994
- Final rev: October 1994
-
-
- About the program "Zawphing"
- ----------------------------
- "Zawphing" is a program that sets the creator and file types of
- files selected in the Finder. Its purpose is to demonstrate
- techniques of sending AppleEvents to the Scriptable Finder to do
- a couple of commonly desired tasks (e.g. get the list of selected
- items). Zawphing is an Application, but it runs like a desk
- accessory; it always has a single open window, and if its window
- is closed, the application quits.
-
-
- Okay, what does "Zawphing" mean?
- --------------------------------
- Whenever I can't think of a suitable name for a program I'm
- about to start, I make up a random sound to identify it with.
- "Zawphing" is the sound that is made when the little wizzard
- zaps the creator/file type of the Finder selection. (Playing
- a sound is an advanced sample left as an exercise for the
- reader's imagination.) The correct pronounciation is "Zaw-PHING";
- "Zawph-ing" is definitely wrong. Remember, it's a sound, not
- a verb.
-
-
- How the Source is organized
- ---------------------------
- Zawphing consists of a number of source files, some of which
- stand on their own, and some of which require support from
- other files in the project. Zawphing has a mini-application
- framework; it's missing key important concepts such as a
- gApplication object, but has some useful window and menu
- framework code. Former MacApp team members can't write even
- simple sample applications without some abstraction. :>
-
-
- The main files that define the application "Zawphing" are:
-
- Main.cp Initializes the Macintosh toolbox and
- begins execution of the application.
-
- SetTypesOfSelection.cp The code that actually sends AppleEvents
- to the Scriptable Finder.
-
- SetTypesDialog.cp This code manages the modeless dialog
- used in this application.
-
- MenuTable.cp A list of function pointers to routines that
- handle the various menu selections. If I had
- a gApplication object and real event dispatching,
- I wouldn't need this silly table.
-
- AboutBox.cp An important file, despite the fact that
- it doesn't do very much.
-
-
- The "Mini-application framework" is defined by the following
- sources:
-
-
- EventHandler.cp Calls WaitNextEvent and dispatches events
- to the appropriate handlers.
-
- MenuHandler.cp Manages application menus. This code is
- old and rather sub-optimal, but it works
- well enough for a simple sample app.
-
- WindowHandler.cp Abstract code that defines a set of virtuals
- that are called by the event handler. Includes
- a class for modeless dialog boxes that handles
- such things as changing the cursor shape to an
- I-beam when it passes over an EditText item.
-
-
- The primary utilities of note are:
-
- AppleEventUtilities.cp A stand-alone set of C++ wrappers for
- the AppleEvent manager. Includes useful
- classes for accessing parameters in
- records, iterating items in lists, and
- building descriptors, lists and records.
-
- Exceptions.cp Very useful code that implements a failure
- handler with Try/Catch semantics. (No dependancies)
-
- ReportError.cp Code that converts O.S. errors into descriptive
- strings. Uses DialogUtilities and StringUtilities.
- Requires DLOG id 30303 and TEXT id 30303.
-
- DialogUtilities.cp Useful code that helps manage modal and modeless
- dialog boxes. Requires StringUtilities.
-
- NextEvent.cp Old code that used to abstract WaitNextEvent
- vs. GetNextEvent for running on System 6 without
- MultiFinder (yes, very old code!). Had some
- problems with native code, so now it just calls
- WaitNextEvent directly, and therefore is of
- marginal value.
- Uses MacUtilities.cp.
-
- MacUtilities.cp Simple, useful routines that many Macintosh
- applications will use. (No dependancies)
-
- StringUtilities.cp Simple code that manages C and Pascal strings.
- Not as useful as a real string class, but better
- than nothing. (No dependancies)
-
-
- And, a header not yet in the standard set but used by Zawphing:
-
- FinderRegistry.h Defines classes, properties, data types and
- error codes used by the Scriptable Finder.
-